<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
//  1.1-100之间偶数相加，求加到几的时候和超过1000：**
var sum =0;
for (var i=0; i<=100;  i++) {
    if(i%2==0){ 
        sum+=i
    }
   
}

console.log(sum);
//  2.   1-100之间偶数相加，能被7整除的数字不参加累加运算，求和
var sum1=0;
for (let i=1; i<=100; i++) {
    if(i%2==0){
     if(i%7==0){
        continue;
    }
    sum1+=i
    }   
}
console.log(sum1);
//  3.   求1999-2022的润年
    for(let i=1999; i<=2022; i++){
        if(i%4==0 && i%100!=0||i%400==0){
            console.log(i);
        }
    }
//  4. 输入分数，如果分数在  90-100: A  80-89：B     60-79：C      小于60：D
// 考虑分数不合法
var score = prompt('请输入一个成绩')
switch (true) {
    case score==null ||score=='':
        alert ('请输入之后点确认');
        break;
    case score>=90 && score<=100:
        alert ('A');
        break;
    case score>=80 && score<=89:
        alert ('B');
        break;
    case score>=60 && score<=79:
        alert ('C');
        break;
    case score>=0 && score<60:
        alert ('D');
        break;
    default:
        break;
}
</script>
</body>
</html>